package com.csun.nusing;

import android.content.Context;

/**
 *
 * 完美单例模式
 * Context,获取context对象
 * ClassName: AppContext 
 * @Description: TODO
 * @author fzq
 * @date 2017-10-18
 */
public class AppContext {

    private Context context;

    private AppContext() {
    }
    private static class SingletonHolder {
        private static AppContext INSTANCE = new AppContext();
    }
    public static AppContext getInstance() {
        return SingletonHolder.INSTANCE;
    }

    public AppContext init(Context context) {
        this.context = context;
        return this;
    }

    public Context getContext() {
        return context;
    }
}
